#ifndef X14_H
#define X14_H

#include "common.h"

template <AllegroVersion version>
struct x14
{
    uint16_t type;
    uint8_t subtype;
    uint8_t layer;

    uint32_t k;
    uint32_t next;

    uint32_t ptr1;

    uint32_t un2;
#if __cplusplus >= 202002L
    COND_FIELD(version >= A_172, uint32_t, un3);
#endif
    uint32_t ptr2;

    // Null or sometimes `x03`
    uint32_t ptr3;

    // `x26`
    uint32_t ptr4;

    uint32_t TAIL;
    operator x14<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus < 202002L
template <> struct x14<A_172>
{
    uint16_t type;
    uint8_t subtype;
    uint8_t layer;

    uint32_t k;
    uint32_t next;

    uint32_t ptr1;

    uint32_t un2;
    uint32_t un3;

    uint32_t ptr2;

    // Null or sometimes `x03`
    uint32_t ptr3;

    // `x26`
    uint32_t ptr4;

    uint32_t TAIL;
    operator x14<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x14<A_174> : x14<A_172> {};
#endif

#endif // X14_H
